<template>
    <div>
        <myback></myback>
    
<div>
    用户注册： <a-input v-model="username" /><br /><br />
     输入密码： <a-input v-model="password"  /><br /><br />
    输入手机号： <a-input v-model="phone"  /><br /><br />
       <a-button @click="submit">注册</a-button>
    </div>
    </div>
</template>

<script>

import myback from './myback'

export default {
    data() {
        return {
            username:'',
            password:'',
            phone:''

        }
    },
    components:{
        'myback':myback
       


  },
    methods: {
        submit(){
      if(this.username == ''){
        this.$toast('请填写用户名');
        return false;
      }
      if(this.password == ''){
        this.$toast('请填写密码');
        return false; 
      }
      
      this.axios.get('http://127.0.0.1:8000/register/',{username:this.username,password:this.password,phone:this.phone}).then(res=>{
       
          alert(res.data.msg)
        
      })
  
    }

    },
    created() {

    }
}
</script>

<style>
com{
    text-align:center;

}

</style>
